home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2436 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  3.3 KB

  1. Path: coke.engr.utk.edu!mbk
  2. From: mbk@I_should_put_my_domain_in_etc_NNTP_INEWS_DOMAIN (Matthew B. Kennel)
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  4. Subject: Re: Hungarian notation
  5. Followup-To: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  6. Date: 17 Jan 1996 20:26:32 GMT
  7. Organization: University of Tennessee, Knoxville
  8. Message-ID: <4djm1o$kf3@gaia.ns.utk.edu>
  9. References: <30C40F77.53B5@swsbbs.com> <marnoldDJEvtJ.1Lx@netcom.com> <4aleun$jlk@ns.RezoNet.NET> <marnoldDJMDBG.CFz@netcom.com> <4asnkr$7b0@solutions.solon.com> <4ath75$e7i@barnacle.iol.ie> <4b4kij$svt@news.microsoft.com> <dewar.819489496@schonberg> <4bd <4cf8hf$8fe@hopi.gate.net> <4cgq30$c0v@weck.brokersys.com> <4cvu68$2jb@macaw.cyberport.com> <4d21og$iab@news.xmission.com>
  10. Reply-To: kennel@msr.epm.ornl.gov
  11. NNTP-Posting-Host: 128.169.100.253
  12. X-Newsreader: TIN [version 1.2 PL2]
  13.  
  14. Todd Knarr (tknarr@xmission.com) wrote:
  15. : In <4cvu68$2jb@macaw.cyberport.com>, tangent@cyberport.com (Warren Young) writes:
  16. : >This is one of the reasons HN is useful.  By forcing the programmer to
  17. : >visit every place that the variable is used, the programmer has an
  18. : >opportunity to check the semantics of the variable's use.  If the type
  19. : >of the variable has changed, chances are that the semantics have
  20. : >changed as well.  How many times have you changed a variable's type to
  21. : >fix something, only to break something else?
  22.  
  23. : I find this is false in practice. In general, when I change the declared
  24. : type of a variable, I'm doing the equivalent of changing an int to a long.
  25. : The result of that in the presence of HN is a massive amount of monkey-work
  26. : to visit and change every occurrence of the variable when the only reason
  27. : for the change is to replace iCount with lCount and nothing more. Since I
  28. : hate doing manual typographic changes like that and it can be difficult or
  29. : impossible to write a script to do it automatically in all files involved,
  30. : I find most often that it does not get done ( and I can't really blame
  31. : the people who didn't do it ).
  32.  
  33. : Changes in semantics do happen, but usually as a side-effect of a major
  34. : change in the fundamental way the code itself works, not as a side-effect
  35. : of a simple type change. As such they require code changes completely
  36. : above and beyond the variable names.
  37.  
  38. Indeed I agree.  I find that I do not always enjoy even having to manifestly
  39. declare types for variables everywhere.  I like static type inference as in
  40. Eiffel and Sather (and others), where the static type of a variable is
  41. derived from the types of other parts of the system.
  42.  
  43. This way, when other parts of the program change in type, the 'irritating' 
  44. little type dependencies may change automatically.
  45.  
  46. Hungarian notation which encodes types is manifest type declaration 
  47. gone haywire. 
  48.  
  49. Naming conventions may be important, but I think local variable names is
  50. the *last* place to worry about this.  
  51.  
  52. More important are types, modules, class categories and patterns. 
  53.  
  54. : --
  55. : Todd Knarr : tknarr@xmission.com      |  finger for PGP public key
  56. :                                       |  Member, USENET Cabal
  57.  
  58. : Seriously, I don't want to die just yet.  I don't care how
  59. : good-looking they are, I! don't! want! to! die!"
  60. :                                         -- Megazone ( UF1 )
  61.  
  62.